/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.spi.assembler.builtin;

import com.inspur.edp.bff.api.manager.context.DeleteContext;
import com.inspur.edp.bff.spi.action.delete.AbstractDeleteAction;
import com.inspur.edp.bff.spi.action.delete.AfterDeleteAction;
import com.inspur.edp.bff.spi.action.delete.BeforeDeleteAction;
import com.inspur.edp.bff.spi.action.multidelete.AbstractMultiDeleteAction;
import com.inspur.edp.bff.spi.action.multidelete.AfterMultiDeleteAction;
import com.inspur.edp.bff.spi.action.multidelete.BeforeMultiDeleteAction;
import com.inspur.edp.bff.spi.assembler.AbstractExtendDeleteAssembler;

import java.util.ArrayList;

public class DefaultExtendDeleteAssembler extends AbstractExtendDeleteAssembler {

    private ArrayList<BeforeDeleteAction> beforeDeleteActions;
    private ArrayList<AbstractDeleteAction> deleteActions;
    private ArrayList<AfterDeleteAction> afterDeleteActions;
    private ArrayList<AbstractMultiDeleteAction> multiDeleteActions;
    private ArrayList<BeforeMultiDeleteAction> beforeMultiDeleteActions;
    private ArrayList<AfterMultiDeleteAction> afterMultiDeleteActions;

    @Override
    protected ArrayList<BeforeDeleteAction> getBeforeDeleteActions(DeleteContext delContext) {
        if (beforeDeleteActions == null)
            beforeDeleteActions = new ArrayList<>();
        return beforeDeleteActions;
    }

    @Override
    protected ArrayList<AbstractDeleteAction> getDeleteActions(DeleteContext delContext) {
        if (deleteActions == null)
            deleteActions = new ArrayList<>();
        return deleteActions;
    }

    @Override
    protected ArrayList<AfterDeleteAction> getAfterDeleteActions(DeleteContext delContext) {
        if (afterDeleteActions == null)
            afterDeleteActions = new ArrayList<>();
        return afterDeleteActions;
    }

    @Override
    protected ArrayList<AbstractMultiDeleteAction> getMultiDeleteActions(DeleteContext deleteContext) {
        if (multiDeleteActions == null)
            multiDeleteActions = new ArrayList<>();
        return multiDeleteActions;
    }


    @Override
    protected ArrayList<BeforeMultiDeleteAction> getBeforeMultiDeleteActions(DeleteContext deleteContext) {
        if (beforeMultiDeleteActions == null)
            beforeMultiDeleteActions = new ArrayList<>();
        return beforeMultiDeleteActions;
    }


    @Override
    protected ArrayList<AfterMultiDeleteAction> getAfterMultiDeleteActions(DeleteContext deleteContext) {
        if (afterMultiDeleteActions == null)
            afterMultiDeleteActions = new ArrayList<>();
        return afterMultiDeleteActions;
    }

}
